<template lang="pug">
  .CommercialHistory
    Modal(
      v-model="isShowCommercialHistory"
      title="查看商保替换历史"
      class-name="vertical-center-modal"
      width="1000"
    )
      Table.beautiful-table(:columns="thead" :data="tableData" :stripe="true")
</template>

<script>
import { Common } from '@/utils/common.js'
import { EmployeeInsuredApi } from '@/api/EmployeeInsured.api.js'
import _cloneDeep from 'clone-deep'
import { CommercialHistoryThead } from '../tableHead.js'

export default {
  name: 'CommercialHistory',

  watch: {
  },

  props: [],

  computed: {
  },

  data () {
    return {
      isShowCommercialHistory: false,
      thead: _cloneDeep(CommercialHistoryThead),
      tableData: [],
    }
  },

  mounted () {
  },

  methods: {
    /**
     * 分页查询接口
     * @param {Object} obj {pageIndex, pageSize}
     */
    async query (id) {
      let params = {
        orderNo: id
      } 
      let res = await EmployeeInsuredApi.getCommercialHistoryList(params)
      console.log('查看商保替换历史res: ', res)
      if (res.status === 200 && res.data.success) {
        this.tableData = res.data.data
        this.isShowCommercialHistory = true 
      } else {
        this.$Message.error({
          content: res.data.message,
          duration: 10,
          closable: true
        })
      }
    },
  }
}
</script>

<style lang="less" scoped>

</style>
